Encryption processing apparatus and encryption processing method

ABSTRACT

An apparatus computing scalar multiplication of a point on an elliptic curve by a scalar value includes an estimation unit configured to estimate a pre-computation amount based on the scalar value, a pre-computation unit configured to perform pre-computation based on the point on the elliptic curve by using the estimated pre-computation amount, a generating unit configured to generate an internal representation of the scalar value by using the estimated pre-computation amount, and a computation unit configured to output a result of the scalar multiplication of the point based on the result of the pre-computation and the internal representation.

BACKGROUND OF THE INVENTION Field of the Invention

The aspect of the embodiments relates to an encryption processing apparatus and an encryption processing method for performing scalar multiplication.

Description of the Related Art

Elliptic curve cryptography has been widely spread as a public key encryption scheme. Standards for Efficient Cryptography Group (SECG) provide recommended elliptic curve parameters in SEC 2 for increased commercial usage of elliptic curve cryptography. National Institute of Standards and Technology (NIST) standardizes ECDSA, which is DSA applying elliptic curve cryptography, in fips 186-3.

Elliptic curve cryptographic processing may need to perform a computation called scalar multiplication. A scalar multiplication is a computation for obtaining kP where k is an integer value and P is a point on an elliptic curve. A scalar multiplication on an elliptic curve using an element assembly generally applies a Non-Adjacent Form (NAF) representation. Japanese Patent Laid-Open No. 2013-186204 discloses use of such a NAF representation. By performing a scalar multiplication using such a representation, kP can be obtained through a lower number of additions than that of a scalar multiplication using a binary representation.

A NAF representation is generated which has digits each having one of values 0, 1, and −1 in a 2-bit window width. Japanese Patent Laid-Open No. 2013-77313 discloses that each of the digits has a higher absolute value in a larger window width.

Alternatively, a MOF representation similar to a NAF representation may be used instead. A MOF representation is a representation which can be generated from left to right or sequentially from the most significant bit. While a window-NAF algorithm applied as a scalar multiplication algorithm performs a computation by using a NAF representation, Japanese Patent Laid-Open No. 2005-316038 discloses that the computation can be performed in combination with a MOF representation.

The window-NAF algorithm may need pre-computation. A required pre-computation amount depends on the window width of a NAF representation or a MOF representation that is an internal representation to be used in an algorithm. However, the window width may be required to be determined before the computation, and, therefore, the optimum size of the window width is not known. The required pre-computation amount exponentially increases every time the window width is increased by 1 bit. Therefore, adjustment of the window width may be difficult.

SUMMARY OF THE INVENTION

An apparatus computing scalar multiplication of a point on an elliptic curve by a scalar value according to an aspect of the present disclosure includes an estimation unit configured to estimate a pre-computation amount based on the scalar value, a pre-computation unit configured to perform pre-computation based on the point on the elliptic curve by using the estimated pre-computation amount, a generating unit configured to generate an internal representation of the scalar value by using the estimated pre-computation amount, and a computation unit configured to output a result of the scalar multiplication of the point on the elliptic curve based on the result of the pre-computation and the internal representation.

Further features of the disclosure will become apparent from the following description of exemplary embodiments with reference to the attached drawings.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates a configuration example of a scalar multiplication computing apparatus.

FIG. 2 illustrates a MOF representation example.

FIG. 3 is a flowchart illustrating processing to be performed by a scalar multiplication computation unit.

FIG. 4 is a flowchart illustrating processing to be performed by a pre-computation unit.

FIG. 5 is a flowchart illustrating processing to be performed by an optimum pre-computation amount estimating unit.

FIG. 6 illustrates a method for generating a MOF representation.

FIG. 7 is a flowchart illustrating an algorithm for generating a MOF representation.

FIG. 8 illustrates clock times when the components illustrated in FIG. 1 operate.

DESCRIPTION OF THE EMBODIMENTS

FIG. 1 illustrates a configuration example of a scalar multiplication computing apparatus according to an embodiment of the present disclosure. The scalar multiplication computing apparatus functions as an encryption processing apparatus and performs scalar multiplication computation for processing based on elliptic curve cryptography that is one of public key encryption schemes relating to a security technology. A scalar multiplication is an operation for calculating kP where k is a scalar value (integer value) and P is a point on an elliptic curve. The scalar multiplication computing apparatus has an optimum pre-computation amount estimating unit 101, a pre-computation unit 102, and an internal representation generating unit 104 and is configured to compute a scalar multiplication of a point P on an elliptic curve by a scalar value k. The scalar multiplication computing apparatus receives a scalar value k and a point P on an elliptic curve and outputs a result kP of a scalar multiplication of the point P on the elliptic curve by the scalar value k. A scalar multiplication computing method for a scalar multiplication computing apparatus will be described below.

The optimum pre-computation amount estimating unit 101 is configured to estimate an optimum pre-computation amount based on the scalar value k. An algorithm to be used in the optimum pre-computation amount estimating unit 101 will be described in detail below. The pre-computation unit 102 is configured to perform pre-computation based on the point P on the elliptic curve by the optimum pre-computation amount obtained by the optimum pre-computation amount estimating unit 101 and outputs a pre-computation result. The internal representation generating unit 103 is configured to generate and output a MOF representation (internal representation) m of the scalar value k by using the optimum pre-computation amount obtained by the optimum pre-computation amount estimating unit 101. A method for generating a MOF representation will be described in detail below. The scalar multiplication computation unit 104 is configured to output a result kP obtained by performing scalar multiplication on the point P on the elliptic curve by the scalar value k based on the pre-computation result by the pre-computation unit 102, the MOF representation m, and the point P.

FIG. 2 illustrates an example of the MOF representation m generated by the internal representation generating unit 103. FIG. 2 illustrates numbers of identical values represented in a binary representation and a MOF representation. A binary representation can represent a value of each digit by 0 or 1 while a MOF representation can represent a value of each digit by 0, a negative number, or a positive number.

FIG. 3 is a flowchart representing an algorithm to be implemented in the scalar multiplication computation unit 104. The scalar multiplication computation unit 104 is a computation unit configured to compute kP by using a window-NAF algorithm. More specifically, the scalar multiplication computation unit 104 obtains kP by performing addition and doubling of a point on an elliptic curve based on values of bits of a MOF representation m of the scalar value k. In step S301, the scalar multiplication computation unit 104 substitutes ∞ for a variable Q representing an intermediate result of the computation for initialization of the variable Q. Here, ∞ is a point representing 0 in an addition process on an elliptic curve. In other words, a relationship P+∞=P holds. Next, in step S302, the scalar multiplication computation unit 104 substitutes a value (of a bit length of the MOF representation m of the scalar value k) being an initial value for i being a loop variable. Next, in step S303, the scalar multiplication computation unit 104 substitutes i−1 for the loop variable i to update the loop variable i. Next, in step S304, the scalar multiplication computation unit 104 doubles the value of the variable Q. In other words, the scalar multiplication computation unit 104 performs doubling of the point on the elliptic curve every one loop for the variable Q. Next, in step S305, the scalar multiplication computation unit 104 determines whether the value mi of the ith bit of the MOF representation m is 0 or not. If the scalar multiplication computation unit 104 determines it is 0, the processing moves to step S307. If not, the processing moves to step S306. In step S306, the scalar multiplication computation unit 104 adds m_(i)P to the intermediate result Q for addition of a point on the elliptic curve. Then processing then moves to step S307. More specifically, because the point corresponding to m_(i)P is obtained in advance by the pre-computation unit 102, the scalar multiplication computation unit 104 adds the preliminary result m_(i)P thereof to Q. In step S307, the scalar multiplication computation unit 104 determines whether the loop variable i is higher than 0 or not. If the scalar multiplication computation unit 104 determines that it is higher than 0, the processing returns to step S303. If the scalar multiplication computation unit 104 determines that it is not higher than 0, the processing moves to step S308. In step S308, the scalar multiplication computation unit 104 outputs the value of the variable Q as a computation result of kP. Then, the processing ends.

Referring to FIG. 3, the doubling in step S304 and the addition in step S306 are heavy processes. Between them, the process in step S306 is skipped if the value m_(i) is equal to 0. The scalar multiplication computation unit 104 performs the addition in step S306 for the number of non-zero digits of the MOF representation m. In other words, the scalar multiplication computation unit 104 adds the value m_(i)P obtained by computing value multiplication of each digit m_(i) at the point P on the elliptic curve if the digits m_(i) of the MOF representation m are not 0. Therefore, the computation cost on the scalar multiplication 104 increases as the number of executions of step S306 increases.

FIG. 4 is a flowchart illustrating an algorithm to be implemented in the pre-computation unit 102. The pre-computation unit 102 performs processing for pre-computing three or more points 3P, 5P, 7P, . . . of odd multiples of the point P on the elliptic curve. In step S401, the pre-computation unit 102 substitutes the point 2P for the variable Q and substitutes the point P for the variable R to initialize the variables Q and R. Next, in step S402, the pre-computation unit 102 substitutes an initial value of 1 for the loop variable i. Next, in step S403, the pre-computation unit 102 adds the variable Q (=2P) to the point of the pre-computation result R of the last loop to perform processing for one pre-computation. The variable Q corresponds to a double value 2P with respect to the point P on the elliptic curve. Next, in step S404, the pre-computation unit 102 registers the computation result R obtained in step S403 as a pre-computation result of (2i+1)P. Next, in step S405, the pre-computation unit 102 substitutes i+1 for the loop variable i. Next, in step S406, the pre-computation unit 102 determines whether the pre-computation has completed by processing an upper limit number of points that can be pre-computed or not with reference to the loop variable i. If not, the processing returns to step S403. If so, the processing ends. Thus, the pre-computation unit 102 can compute the three or more points 3P, 5P, 7P, . . . of odd multiples of the point P on the elliptic curve.

Referring to FIG. 4, the doubling in step S401 and the addition in step S403 are heavy processes. Between them, the addition in step S403 is repeatedly executed the number of times corresponding to the pre-computation amount. Therefore, the computation cost on the pre-computation unit 102 increases as the number of executions of the process in step S403 increases.

The computation cost on the pre-computation unit 102 and the computation cost on the scalar multiplication 104 constitute the entire processing cost. Referring to FIGS. 3 and 4, these computation costs depend on the numbers of times of execute of the processes in step S306 and S403. Here, because the addition processes are performed both in steps S306 and S403, the computation costs are equal in steps S306 and step S403. Therefore, in order to estimate a pre-computation amount which produces a minimum entire computation cost, a pre-computation amount for a minimum sum of the number of executions of the process in step S306 and the number of execution of the process in step S403 is obtained by the optimum pre-computation amount estimating unit 101.

FIG. 5 is a flowchart illustrating an algorithm to be implemented in the optimum pre-computation amount estimating unit 101. In step S501, in order to initialize a variable r for holding a provisional optimum pre-computation amount and a variable min_cost for holding the cost then, the optimum pre-computation amount estimating unit 101 substitutes 0 for the variable r and substitutes ∞ for the variable min_cost. Next, in step S502, in order to initialize the loop variable i, the optimum pre-computation amount estimating unit 101 substitutes a minimum value of the pre-computation amount for the loop variable i. Next, in step S503, the optimum pre-computation amount estimating unit 101 substitutes the number of non-zero digits of the MOF representation m of k for a variable “count” where pre-computations about P, 3P, 5P, . . . , (2i+1)P are executed with the pre-computation amount is equal to i. In this case, the variable i represents the number of executions of the process in step S306, and the variable “count” represents the number of executions of the process in step S403. The value to be substituted for the variable “count” will be described below. Next, in step S504, in order to determine whether the computation cost is minimum, the optimum pre-computation amount estimating unit 101 determines whether the sum of the variable i representing the number of executions of the process in step S306 and the variable “count” representing the number of executions of the process in step S403 is lower than the variable min_cost or not. If the optimum pre-computation amount estimating unit 101 determines that the sum is lower than the variable min_cost, the processing moves to step S505. If not, the processing moves to step S506. In step S505, the optimum pre-computation amount estimating unit 101 substitutes the pre-computation amount i that is a provisional optimum pre-computation amount for the variable r and substitutes the sum of the variable i and the variable “count” for the variable min_cost. Next, in step S506, the optimum pre-computation amount estimating unit 101 substitutes i+1 for the loop variable i. Next, in step S507, the optimum pre-computation amount estimating unit 101 determines whether the loop variable i is equal to or lower than a maximum value of the pre-computation amount or not. If the optimum pre-computation amount estimating unit 101 determines that the loop variable i is equal to or lower than the maximum value, the processing moves to step S503. If not, the processing moves to step S508. In step S508, the optimum pre-computation amount estimating unit 101 outputs the value of the variable r as an optimum pre-computation amount. The processing then ends. The pre-computation unit 102 in step S406 compares the optimum pre-computation amount r and the loop variable i to determine a pre-computation amount. The pre-computation unit 102 performs the addition in step S403 the number of times corresponding to the optimum pre-computation amount r estimated by the optimum pre-computation amount estimating unit 101.

The optimum pre-computation amount estimating unit 101 estimates, as an optimum pre-computation amount r, the pre-computation amount for a minimum sum of the number “count” of non-zero digits of the MOF representation m for each different pre-computation amount obtained by the pre-computation 102 and the pre-computation amount i obtained by the pre-computation unit 102, as described above.

FIG. 6 is a schematic explanatory diagram illustrating a MOF generation algorithm to be implemented in step S503 and in the internal representation generating unit 103. A binary representation 601 represents a scalar value k in a binary number. An intermediate representation 602 represents a value of 2k-k. Because 2k-k and k have an identical value, the binary representation 601 and the intermediate representation 602 represent an identical value. However, the intermediate representation 602 computes 2k-k without borrowing across digits. It means that, when one digit has a value “0” in 2k and value “1” in k, the digit has a value “−1” in the intermediate representation 602. The MOF representation 603 represents one digit collectively representing values of a plurality of digits in the intermediate representation 602. Through this procedure, the internal representation generating unit 103 converts the binary representation 601 to the MOF representation 603 with respect to the scalar value k.

FIG. 7 is a flowchart illustrating a MOF generation algorithm to be implemented in step S503 and in the internal representation generating unit 103. The scalar value k has bits having values b_(u), b_(u−1), b₁, b₀ represented in the intermediate representation 602 where the bit length of the scalar value k is equal to u. A MOF representation m to be generated by the algorithm has bits having m_(u), m_(u−1), . . . , m₁, m₀. In step S701, the internal representation generating unit 103 substitutes the value of the bit length of k for a variable j, substitutes 0 for a variable t holding a provisional value of m_(j), and substitutes 0 for the variable “count” representing the number of non-zero digits of the MOF representation. The variable j is a variable representing the digit to be output next. The variable “count” has a value to be used in step S503. Next, in step S702, the internal representation generating unit 103 substitutes the bit length of k for the loop variable i. Next, in step S703, the internal representation generating unit 103 determines whether the provisional value t of m_(j) is equal to 0 or not. If so, the processing moves to step S704. If not, the processing moves to step S707. In step S704, the internal representation generating unit 103 determines whether a digit b_(i) of the ith bit of the intermediate representation has 0 or not. If so, the processing moves to step S705. If not, the processing moves to step S706. In step S705, because both of the provisional value t and the intermediate representation b_(i) have 0, the internal representation generating unit 103 substitutes 0 for m and substitutes j−1 for the variable j. The processing moves to step S711. In step S706, because the intermediate representation b_(i) does not have 0, the internal representation generating unit 103 substitutes b_(i) for the provisional value t. The processing moves to step S711. In step S707, the internal representation generating unit 103 determines whether the digit b_(i) of the ith bit of the intermediate representation has 0 or not. If so, the processing moves to step S711. If not, the processing moves to step S708. In step S708, because the provisional value t is not 0 and the intermediate representation b_(i) is not 0, the internal representation generating unit 103 determines whether the provisional value t is to be updated or whether provisional value t is to be output as m_(j). More specifically, a value (2^(j−1)t+b_(i)) is obtained if the provisional value t is updated, but the provisional value t can be updated if the point at |2^(j−i)t+b_(i)|P is already given as a pre-computation result. Accordingly, the internal representation generating unit 103 determines whether the point at |2^(j−i)t+b_(i)|P is already given as a pre-computation result or not based on the optimum pre-computation amount r output from the optimum pre-computation amount estimating unit 101. If the internal representation generating unit 103 determines so, the processing moves to step S709. If not, the processing moves to step S710. In step S709, the internal representation generating unit 103 outputs 0 as m_(j), m_(j−1), . . . , m_(i+1), substitutes (2^(j−i)t+b_(i)) for the provisional value t, and substitutes i for the variable j. The processing then moves to step S711. In S710, the internal representation generating unit 103 outputs the provisional value t as a value of m_(j), substitutes “count+1” for the variable “count”, outputs m_(j−i), m_(j−2), . . . , m_(j+1) as 0, substitutes b_(i) for the provisional value t, and substitutes i for the variable j. The processing then moves to step S711. In step S711, the internal representation generating unit 103 substitutes i−1 for the loop variable i. Next, in step S712, the internal representation generating unit 103 determines whether the loop variable i is equal to or higher than 0 or not. If so, the processing returns to step S703. If not, the processing moves to step S713. In step S713 the internal representation generating unit 103 determines whether the variable j is equal to or higher than 0 to check whether any provisional value t has not been output. If so, the processing moves to step S714. If not, the processing ends. In step S714, the internal representation generating unit 103 outputs the provisional value t as a value of m substitutes “count+1” for the variable “count”, and outputs 0 as a value of the remaining digits m_(j−i), m_(j−2), . . . , m₀. Then, the processing ends.

FIG. 8 illustrates clock times when the optimum pre-computation amount estimating unit 101, the pre-computation unit 102, the internal representation generating unit 103, and the scalar multiplication computation unit 104 illustrated in FIG. 1 operate. First of all, the optimum pre-computation amount estimating unit 101 and the pre-computation unit 102 operate simultaneously and perform respective processes in parallel. The optimum pre-computation amount estimating unit 101 decides an optimum pre-computation amount r. When the pre-computation unit 102 completes the pre-computation up to the optimum pre-computation amount r, the internal representation generating unit 103 and the scalar multiplication computation unit 104 start operating simultaneously and perform respective processes in parallel. Because both of the MOF generation algorithm and the scalar multiplication algorithm process sequentially from the most significant bit (from left to right), the internal representation generating unit 103 and the scalar multiplication computation unit 104 perform their processes in synchronization. The internal representation generating unit 103 generates a MOF representation m sequentially from the most significant bit, and the scalar multiplication computation unit 104 processes sequentially from the most significant bit.

The optimum pre-computation amount estimating unit 101 estimates a computation cost of kP for various pre-computation amounts assumed in a case where a MOF representation is generated with the various pre-computation amounts to obtain an optimum pre-computation amount r producing a minimum computation cost of kP. More specifically, the optimum pre-computation amount estimating unit 101 regards the sum of the number of non-zero digits and the number of pre-computation amounts in a case where the scalar value k is represented by a MOF representation as computation cost and obtains an optimum pre-computation amount r for minimizing the sum. The internal representation generating unit 103 generates the MOF representation m based on the optimum pre-computation amount r instead of a window width. The scalar multiplication computing apparatus performs scalar multiplication based on an optimum pre-computation amount r estimated by using the MOF representation m to obtain kP with minimum computation cost, which can result in an improved throughput.

Other Embodiments

Embodiment(s) of the disclosure can also be realized by a computer of a system or apparatus that reads out and executes computer executable instructions (e.g., one or more programs) recorded on a storage medium (which may also be referred to more fully as a ‘non-transitory computer-readable storage medium’) to perform the functions of one or more of the above-described embodiment(s) and/or that includes one or more circuits (e.g., application specific integrated circuit (ASIC)) for performing the functions of one or more of the above-described embodiment(s), and by a method performed by the computer of the system or apparatus by, for example, reading out and executing the computer executable instructions from the storage medium to perform the functions of one or more of the above-described embodiment(s) and/or controlling the one or more circuits to perform the functions of one or more of the above-described embodiment(s). The computer may comprise one or more processors (e.g., central processing unit (CPU), micro processing unit (MPU)) and may include a network of separate computers or separate processors to read out and execute the computer executable instructions. The computer executable instructions may be provided to the computer, for example, from a network or the storage medium. The storage medium may include, for example, one or more of a hard disk, a random-access memory (RAM), a read only memory (ROM), a storage of distributed computing systems, an optical disk (such as a compact disc (CD), digital versatile disc (DVD), or Blu-ray Disc (BD)™), a flash memory device, a memory card, and the like.

While the disclosure has been described with reference to exemplary embodiments, it is to be understood that the disclosure is not limited to the disclosed exemplary embodiments. The scope of the following claims is to be accorded the broadest interpretation so as to encompass all such modifications and equivalent structures and functions.

This application claims the benefit of Japanese Patent Application No. 2017-041451 filed Mar. 6, 2017, which is hereby incorporated by reference herein in its entirety. 

What is claimed is:
 1. An apparatus for computing scalar multiplication of a point on an elliptic curve by a scalar value, the apparatus comprising: an estimation unit configured to estimate a pre-computation amount based on the scalar value; a pre-computation unit configured to perform pre-computation based on the point on the elliptic curve by using the estimated pre-computation amount; a generating unit configured to generate an internal representation of the scalar value by using the estimated pre-computation amount; and a computation unit configured to output a result of the scalar multiplication of the point on the elliptic curve based on the result of the pre-computation and the generated internal representation.
 2. The apparatus according to claim 1, wherein the estimation unit estimates the pre-computation amount based on a number of non-zero digits of the internal representation for each of different pre-computation amounts.
 3. The apparatus according to claim 1, wherein the estimation unit estimates the pre-computation amount based on a sum of the number of non-zero digits and the pre-computation amount of the pre-computation unit.
 4. The apparatus according to claim 1, wherein the estimation unit estimates, as the pre-computation amount, a pre-computation amount producing a minimum sum of the number of non-zero digits and the pre-computation amount.
 5. The apparatus according to claim 2, wherein the computation unit performs an addition a number of times equal to the number of non-zero digits of the internal representation.
 6. The apparatus according to claim 3, wherein the pre-computation unit performs an addition for the estimated pre-computation amount.
 7. The apparatus according to claim 1, wherein the internal representation is a MOF representation.
 8. The apparatus according to claim 1, wherein the pre-computation unit computes three or more odd multiples of the point on the elliptic curve.
 9. The apparatus according to claim 8, wherein the pre-computation unit repeats a process for adding a double value of the point on the elliptic curve for the estimated pre-computation amount.
 10. The apparatus according to claim 2, wherein, in a case where digits of the internal representation do not have (zero), the computation unit adds a value obtained by scalar multiplication of the point on the elliptic curve by values of the digits.
 11. The apparatus according to claim 1, wherein the generating unit generates the internal representation sequentially from a most significant bit.
 12. The apparatus according to claim 1, wherein the computation unit processes sequentially from a most significant bit.
 13. The apparatus according to claim 1, wherein processing by the generating unit and processing by the computation unit are performed in parallel.
 14. The apparatus according to claim 1, wherein processing by the estimation unit and processing by the pre-computation unit are performed in parallel.
 15. The apparatus according to claim 13, wherein, after processing by the pre-computation unit completes up to a predetermined amount, processing by the generating unit and processing by the computation unit are performed in parallel.
 16. The apparatus according to claim 1, wherein the internal representation is a binary representation.
 17. The apparatus according to claim 1, further comprising an encryption processing unit configured to perform an encryption process based on an output from the computation unit.
 18. A method for computing scalar multiplication of a point on an elliptic curve by a scalar value, the method comprising: estimating a pre-computation amount based on the scalar value; performing pre-computation based on the point on the elliptic curve by using the estimated pre-computation amount; generating an internal representation of the scalar value by using the estimated pre-computation amount; and outputting a result of the scalar multiplication of the point on the elliptic curve based on the result of the pre-computation and the internal representation.
 19. A non-transitory storage medium storing a program causing a computer to implement a method for computing scalar multiplication of a point on an elliptic curve by a scalar value, the method comprising: estimating a pre-computation amount based on the scalar value; performing pre-computation based on the point on the elliptic curve by using the estimated pre-computation amount; generating an internal representation of the scalar value by using the estimated pre-computation amount; and outputting a result of the scalar multiplication of the point on the elliptic curve based on the result of the pre-computation and the internal representation. 